function TillingPattern(pdObjs) {
    /** matrix from pattern to parent stream. */
    this.m_mtPattern2Form = new PDMatrix();
    this.m_mtParentMatrix = new PDMatrix();
    this.m_bClred = false;
    this.m_BBox = [0, 0, 0, 0]; //[l,t,r,b]
    this.m_xStep = 0;
    this.m_yStep = 0;
    this.m_pdForm = null; //PDForm instance
    this.m_pdObjs = pdObjs;
}

TillingPattern.prototype.FromJson = function (jsonData) {
    var t = new TillingPattern();
    t.ParseJson(jsonData);
    return t;
}

TillingPattern.prototype.ParseJson = function (arrayData) {
    //var temp = this;
    var arrtemp = stringArr2NumArr(arrayData[1]);
    this.m_mtPattern2Form.Set(arrtemp[0],arrtemp[1],arrtemp[2],arrtemp[3],arrtemp[4],arrtemp[5]);
    arrtemp = stringArr2NumArr(arrayData[2]);
    this.m_mtParentMatrix.Set(arrtemp[0],arrtemp[1],arrtemp[2],arrtemp[3],arrtemp[4],arrtemp[5]);
    this.m_BBox = stringArr2NumArr(arrayData[0]);
    this.m_xStep = arrayData[4];
    this.m_yStep = arrayData[5];
    this.m_bClred = arrayData[3];
    this.m_pdForm = PDForm.prototype.FromJson(arrayData[6]);
}

TillingPattern.prototype.ParseFromBin = function(rd){
	
	var left = rd.readFloat32(),
	    top = rd.readFloat32(),
	    right = rd.readFloat32(),
	    bottom = rd.readFloat32();
	this.m_BBox = [left,top,right,bottom];
	
	var a = rd.readFloat32(),
	    b = rd.readFloat32(),
	    c = rd.readFloat32(),
	    d = rd.readFloat32(),
	    e = rd.readFloat32(),
	    f = rd.readFloat32();
	this.m_mtPattern2Form.Set(a,b,c,d,e,f);
	
	var h = rd.readFloat32(),
	    i = rd.readFloat32(),
	    j = rd.readFloat32(),
	    k = rd.readFloat32(),
	    l = rd.readFloat32(),
	    m = rd.readFloat32();
	this.m_mtParentMatrix.Set(h,i,j,k,l,m);
	
	this.m_bClred = rd.readByte();
	this.m_xStep = rd.readFloat32();
	this.m_yStep = rd.readFloat32();
	this.m_pdForm = new PDForm(this.m_pdObjs.m_pdDoc, this.m_pdObjs.m_csImgPath);
	this.m_pdForm.ParseFromBin(rd);
	
}
